package LanQiao.jichu;

import java.util.Scanner;

//数列特征
public class BASIC_4 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int num = scanner.nextInt();
        int min = num, max = num, sum = num;
        for (int i = 1; i < n; i++) {
            int number = scanner.nextInt();
            if (number > max) {
                max = number;
            }
            if (number < min) {
                min = number;
            }
            sum += number;
        }
        System.out.println(max + "\n" + min + "\n" + sum);
    }
}

